<!-- templates/view_events.html -->
{% extends "base.html" %}

{% block content %}
<h2>所有事件</h2>
<table>
    <thead>
        <tr>
            <th>ID</th>
            <th>类型</th>
            <th>时间戳</th>
            <th>数据</th>
        </tr>
    </thead>
    <tbody>
        {% for event in events %}
        <tr>
            <td>{{ event.id }}</td>
            <td>{{ event.event_type }}</td>
            <td>{{ event.timestamp }}</td>
            <td>{{ event.data }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

<div class="pagination">
    {% if pagination.has_prev %}
        <a href="{{ url_for('view_events', page=pagination.prev_num) }}">上一页</a>
    {% endif %}
    <span>第 {{ pagination.page }} 页，共 {{ pagination.pages }} 页</span>
    {% if pagination.has_next %}
        <a href="{{ url_for('view_events', page=pagination.next_num) }}">下一页</a>
    {% endif %}
</div>
{% endblock %}
